<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/wmsproject/warehouse/Wms_Stock.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/wmsproject/warehouse/Wms_Stock.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Wms_Stock",
        setup() {
            const table = ref({
                key: "StockId",
                footer: "Foots",
                cnName: "库位管理",
                name: "warehouse/Wms_Stock",
                newTabEdit: false,
                url: "/Wms_Stock/",
                sortName: "StockId"
            });
            const editFormFields = ref({"WarehouseId":"","ZoneId":"","RackId":"","StockRow":"","StockLevel":"","StockType":"","StockName":"","StockCode":"","Width":"","Height":"","Length":"","Weight":"","FreightStatus":"","IssueType":"","SpecificMaterial":"","AllowDiffMaterial":"","AllowDiffLot":"","ForbidOutbound":"","ForbidInbound":"","ForbidOutboundComments":"","ForbidInboundComments":"","Enabled":""});
            const editFormOptions = ref([[{"dataKey":"WMS_Warehouse","data":[],"title":"仓库","field":"WarehouseId","colSize":12,"type":"select"},
                               {"dataKey":"WMS_Zone","data":[],"title":"库区","required":true,"field":"ZoneId","colSize":12,"type":"select"},
                               {"dataKey":"WMS_Rack","data":[],"title":"货架","field":"RackId","colSize":12,"type":"select"}],
                              [{"dataKey":"WMS_StockType","data":[],"title":"库位类型","required":true,"field":"StockType","colSize":12,"type":"select"},
                               {"title":"列数","required":true,"field":"StockRow","colSize":12,"type":"number"},
                               {"title":"层数","required":true,"field":"StockLevel","colSize":12,"type":"number"}],
                              [{"title":"库位编号","required":true,"field":"StockCode","colSize":12},
                               {"title":"库位名称","field":"StockName","colSize":12,"type":"text"}],
                              [{"title":"长(cm)","field":"Length","type":"decimal"},
                               {"title":"承重(kg)","field":"Weight","type":"decimal"},
                               {"title":"宽(cm)","field":"Width","type":"decimal"},
                               {"title":"高(cm)","field":"Height","type":"decimal"}],
                              [{"dataKey":"WMS_IsCarryCargo","data":[],"title":"载货状态","field":"FreightStatus","disabled":true,"colSize":12,"type":"select"},
                               {"dataKey":"WMS_StockStatus","data":[],"title":"库位状态","field":"IssueType","disabled":true,"colSize":12,"type":"select"}],
                              [{"dataKey":"enabled","data":[],"title":"允许混商品","required":true,"field":"AllowDiffMaterial","colSize":12,"type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"允许混批次","required":true,"field":"AllowDiffLot","colSize":12,"type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"是否指定商品","required":true,"field":"SpecificMaterial","colSize":12,"type":"switch"}],
                              [{"dataKey":"enabled","data":[],"title":"是否禁入","required":true,"field":"ForbidInbound","colSize":12,"type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"是否禁出","required":true,"field":"ForbidOutbound","colSize":12,"type":"switch"}],
                              [{"title":"禁入备注","field":"ForbidInboundComments","colSize":12,"type":"textarea"},
                               {"title":"禁出备注","field":"ForbidOutboundComments","colSize":12,"type":"textarea"}],
                              [{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","colSize":12,"type":"switch"}]]);
            const searchFormFields = ref({"WarehouseId":"","ZoneId":"","StockName":"","StockCode":"","StockType":""});
            const searchFormOptions = ref([[{"dataKey":"WMS_Zone","data":[],"title":"库区","field":"ZoneId","type":"select"},{"title":"库位名称","field":"StockName","type":"like"},{"dataKey":"WMS_StockType","data":[],"title":"库位类型","field":"StockType","type":"select"}],[{"dataKey":"WMS_Warehouse","data":[],"title":"仓库","field":"WarehouseId","type":"select"},{"title":"库位编号","field":"StockCode","type":"like"}]]);
            const columns = ref([{field:"StockId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"WarehouseId",title:"仓库",type:"bigint",bind:{ key:"WMS_Warehouse",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ZoneId",title:"库区",type:"bigint",bind:{ key:"WMS_Zone",data:[]},width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"RackId",title:"货架",type:"bigint",bind:{ key:"WMS_Rack",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"StockName",title:"库位名称",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"StockCode",title:"库位编号",type:"string",link:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StockRow",title:"列数",type:"int",width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StockLevel",title:"层数",type:"int",width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StockType",title:"库位类型",type:"int",bind:{ key:"WMS_StockType",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"FreightStatus",title:"载货状态",type:"int",bind:{ key:"WMS_IsCarryCargo",data:[]},width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"IssueType",title:"库位状态",type:"int",bind:{ key:"WMS_StockStatus",data:[]},width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"Width",title:"宽(cm)",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Height",title:"高(cm)",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Length",title:"长(cm)",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Weight",title:"承重(kg)",type:"decimal",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ForbidOutbound",title:"是否禁出",type:"int",bind:{ key:"enabled",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"ForbidOutboundComments",title:"禁出备注",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ForbidInbound",title:"是否禁入",type:"int",bind:{ key:"enabled",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"ForbidInboundComments",title:"禁入备注",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"SpecificMaterial",title:"是否指定商品",type:"int",bind:{ key:"enabled",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"AllowDiffMaterial",title:"允许混商品",type:"int",bind:{ key:"enabled",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"AllowDiffLot",title:"允许混批次",type:"int",bind:{ key:"enabled",data:[]},width:110,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"}]);
            const detail = ref(  {
                    cnName: "物料配置",
                    table: "Wms_StockMat",
                    columns: [{field:"StockMatId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialId",title:"物料",type:"bigint",bind:{ key:"WMS_Material",data:[]},width:110,edit:{type:"selectList"},showOverflowTooltip:true,align:"left"},
                       {field:"StockId",title:"库位号",type:"bigint",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,edit:{type:"textarea"},showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"}],
                    sortName: "StockMatId",
                    key: "StockMatId"
                                            });
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
